-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a pretty printer for &mut slices #34550
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@bors r+ Adding an lldb test can be an easy bug (or I might just fix it myself) |
📌 Commit 688f8f8 has been approved by |
Thanks! |
heh, I should be the one thanking you for patiently answering every question I had! |
⌛ Testing commit 688f8f8 with merge be76d67... |
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
@bors retry
|
⌛ Testing commit 688f8f8 with merge 23e5104... |
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
Looks like the builder is broken. We'll retry this later. |
@bors: retry On Fri, Jul 1, 2016 at 6:19 AM, Manish Goregaokar [email protected]
|
⌛ Testing commit 688f8f8 with merge bbd39ac... |
💔 Test failed - auto-linux-64-x-android-t |
@@ -53,6 +53,11 @@ | |||
// gdb-command:print *((int64_t[2]*)('vec_slices::MUT_VECT_SLICE'.data_ptr)) | |||
// gdb-check:$15 = {64, 65} | |||
|
|||
//gdb-command:print mut_slice.length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, these tests are unnecessary, we just need a test that verifies that printing mut_slice gives properly formatted results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that is done in the second test, right? I looked at the buildbot logs and noticed that's exactly where the build was failing:
---- [debuginfo-gdb] debuginfo-gdb/vec-slices.rs stdout ----
error: line not found in debugger output: $17 = {1, 2, 3, 4, 5}
status: exit code: 0
command: arm-linux-androideabi-gdb -quiet -batch -nx -command=x86_64-unknown-linux-gnu/test/debuginfo-gdb/vec-slices.debugger.script
stdout:
------------------------------------------
Edit:
Also, the output in stderr:
x86_64-unknown-linux-gnu/test/debuginfo-gdb/vec-slices.debugger.script:24: Error in sourced command file:
No symbol "int32_t" in current context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second one casts it to an array and tries to print it. That relies on the C pretty printer, not ten Rust one. print slice
and print mut_slice
should be what we are testing. I don't see the value in the array-cast test for mut slices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print mut_slice
just shows the data pointer and the array's length. I looked at the pretty-printer's code as well, but I couldn't understand much :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that's what we've been trying to fix here 😄 print mut_slice
should show an array, just like print slice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, these tests aren't run with rust-gdb, it would appear as if rust-gdb doesn't have tests. So remove the test changes and we can land this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the error is occurring due to absence of int32_t
, maybe I could change the type to i64
, since previous examples have used it, and obviously they have passed all the tests/builds. what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
@bors r+ |
📌 Commit 036b089 has been approved by |
⌛ Testing commit 036b089 with merge d98da85... |
Added a pretty printer for &mut slices Fixes #30232 I have added a test which checks for correctness in gdb, but I need some help to do the same for lldb. r? @Manishearth
It worked! 😎 🎉 |
Fixes #30232
I have added a test which checks for correctness in gdb, but I need some help to do the same for lldb.
r? @Manishearth